using System;
using System.Text;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Toon.Models.Characters;

namespace Toon.Models.Tests.Characters
{
	
	public partial class ShitckTests
	{


		
		
        
    	[TestMethod]
        public void ShitckTests_Memory_ShitckDefinition()
		{

            Func<WeakReference> ctr = () =>
            {
			    try
			    {
				    return new WeakReference( new Toon.Models.Characters.Shitck(new Toon.Models.Catalogs.ShitckDefinition("A", default(System.Int32), "A")) );
			    }
			    catch (ArgumentException)
			    {
                    return null;
			    }
            };

            var wr = ctr();
            if (wr == null) 
                return; //unable to create object, test aborted
			
            GC.Collect();
			GC.WaitForPendingFinalizers();
			GC.Collect();

			//verify the object was collected
			Assert.IsFalse(wr.IsAlive);		
		}
				
			
	}
}

